package com.study.controller;

import com.study.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName: HelloController
 * @Description:
 * @author: WS
 * @date 2020/12/8
 * @Version: 1.0
 **/
@RestController
public class HelloController {
    @Autowired
    HelloService service;
    @GetMapping("/hello")
    public String sayHello(){
        return service.sayHello();
    }
    @GetMapping("/data")
    public List<String> getData(){
        List<String> list=new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            list.add("ArrayList add"+i);
        }
        return list;
    }
}
